import { createRouter, createWebHistory } from 'vue-router'
import login from "../views/login.vue"
import register from "../views/register.vue"
import Layout from "../layout/Layout.vue"
import error from "../components/error.vue"
const routes= [
    {
        path: '/',
        name: 'Layout',
        component: Layout,
        redirect: "/mycase",
        children: [
          {
            path: 'mycase',
            name: 'Mycase',
            component: () => import("@/views/Mycase.vue")
          },
          {
            path: 'generator',
            name: 'Generator',
            component: () => import("@/views/Generator.vue")
          },
          {
            path: 'diagnostic',
            name: 'Diagnostic',
            component: () => import("@/views/Diagnostic.vue")
          },
          {
            path: 'compare',
            name: 'Compare',
            component: () => import("@/views/Compare.vue")
          },
        ]
    },
    {
        path:"/error",
        component:error
    },
    {
        path:"/login",
        component:login
    },
    {
      path:"/register",
      component:register
    },

    
]
const  router=createRouter({
    // history:createWebHashHistory(),
    history: createWebHistory(process.env.BASE_URL),
    routes
})

export default router;